<?php
namespace app\admin\controller;

use app\admin\model\SystemAdmin;
use app\admin\model\SystemMenu;
use app\BaseController;
use think\facade\Db;
use think\facade\Log;
use think\App;
use think\facade\View;

class Index extends BaseController
{
    public function index()
    {
        $adminId = session('admin_id');
        $systemAdminModel = new SystemAdmin();
        $systemMenuModel = new SystemMenu();
        $adminInfo = $systemAdminModel->getAdminInfoById($adminId);
        if(cache('menu_list')){
                $menuList = cache('menu_list');
        }else{
            $menuList = $systemMenuModel->adminMenu($adminInfo->toArray());
            ///cache('menu_list',$menuList,14400);
        }
        //dd($menuList);
        View::assign('menuList', $menuList);
        return View::fetch('index/index');
    }


          
  

}


